Adwaita: more flexible headerbar_fill mixin
authorLapo Calamandrei <calamandrei@gmail.com>
Thu, 5 May 2016 16:36:03 +0000 (18:36 +0200)
committerLapo Calamandrei <calamandrei@gmail.com>
Thu, 5 May 2016 16:36:03 +0000 (18:36 +0200)
add an additional background layer as a parameter.

gtk/theme/Adwaita/_drawing.scss
gtk/theme/Adwaita/gtk-contained-dark.css
gtk/theme/Adwaita/gtk-contained.css

index b6a302d6a60aa15fdb624c5f095abf1bfaf2e3bc..a48a7896c00b8bfec21b2b5e976099749daaa94a 100644 (file)
   }
 }
 
-@mixin headerbar_fill($c:$headerbar_color, $hc:$top_hilight) {
+@mixin headerbar_fill($c:$headerbar_color, $hc:$top_hilight, $ov: none) {
 //
 // headerbar fill
 //
 // $c:  base color
 // $hc: top highlight color
+// $ov: a background layer for background shorthand (hence no commas!)
 //
+  $gradient: linear-gradient(to top, darken($c, 13%), darken($c, 2%) 2px, $c 3px);
 
-  @if $variant == 'light' { background-image: linear-gradient(to top, darken($c, 13%), darken($c, 2%) 2px, $c 3px); }
-  @else { background-image: linear-gradient(to top, darken($c, 3%), darken($c, 1%) 2px, $c 3px); }
+  @if $variant == 'dark' { $gradient: linear-gradient(to top, darken($c, 3%), darken($c, 1%) 2px, $c 3px); }
+
+  @if $ov != none { background: $c $ov, $gradient; }
+  @else { background: $c $gradient; }
 
-  background-color: $c;
   box-shadow: inset 0 1px $hc; // top highlight
 }
 
index 0bf0b90f5362e9248057c642bf5a5fc84a61ec4f..9d256e488124e7e6a9aa6f832d08e06c9b673fcf 100644 (file)
@@ -1773,8 +1773,7 @@ headerbar {
   border-style: solid;
   border-color: #0b0c0c;
   border-radius: 0;
-  background-image: linear-gradient(to top, #25292b, #2a2e30 2px, #2c3133 3px);
-  background-color: #2c3133;
+  background: #2c3133 linear-gradient(to top, #25292b, #2a2e30 2px, #2c3133 3px);
   box-shadow: inset 0 1px rgba(238, 238, 236, 0.07); }
   .titlebar:backdrop:not(headerbar),
   headerbar:backdrop {
@@ -1798,8 +1797,7 @@ headerbar {
     color: #ffffff;
     border-color: #0f2b48;
     text-shadow: 0 -1px rgba(0, 0, 0, 0.5);
-    background-image: linear-gradient(to top, #1e5690, #205b98 2px, #215d9c 3px);
-    background-color: #215d9c;
+    background: #215d9c linear-gradient(to top, #1e5690, #205b98 2px, #215d9c 3px);
     box-shadow: inset 0 1px rgba(40, 98, 159, 0.535); }
     .selection-mode.titlebar:backdrop:not(headerbar),
     headerbar.selection-mode:backdrop {
index 2328c36cc06f3235ad440c702ddf9bf8f498053b..bc43cf18b18c53bf4d26bf9bbec1341b276c362c 100644 (file)
@@ -1780,8 +1780,7 @@ headerbar {
   border-style: solid;
   border-color: #91918c;
   border-radius: 0;
-  background-image: linear-gradient(to top, #d4d4d2, #efefef 2px, #f4f4f4 3px);
-  background-color: #f4f4f4;
+  background: #f4f4f4 linear-gradient(to top, #d4d4d2, #efefef 2px, #f4f4f4 3px);
   box-shadow: inset 0 1px rgba(255, 255, 255, 0.8); }
   .titlebar:backdrop:not(headerbar),
   headerbar:backdrop {
@@ -1805,8 +1804,7 @@ headerbar {
     color: #ffffff;
     border-color: #184472;
     text-shadow: 0 -1px rgba(0, 0, 0, 0.5);
-    background-image: linear-gradient(to top, #276fba, #428bd7 2px, #4a90d9 3px);
-    background-color: #4a90d9;
+    background: #4a90d9 linear-gradient(to top, #276fba, #428bd7 2px, #4a90d9 3px);
     box-shadow: inset 0 1px rgba(146, 188, 232, 0.9); }
     .selection-mode.titlebar:backdrop:not(headerbar),
     headerbar.selection-mode:backdrop {